package model.cnf;

/**
 * represent a literal
 * @author stephane
 *
 */
public class Literal{
    
	int value;
    
    public Literal(int value){
    	this.value=value;
    }

    public Literal(int var, boolean polarity){
    	value=(polarity?var:-var);
    }
    
    /**
     * return a literal with the opposite value of the current literal
     * @return a literal with the opposite value of the current literal
     */
    public Literal oppositeLiteral(){
    	return new Literal(-value);
    }

    public String toString(){
    	return String.valueOf(value);
    }

    public int getVar(){
    	return Math.abs(value);
    }
    
}